home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / editor / frexxed / fpl / eface.fpl < prev    next >
Text File  |  1996-03-18  |  2KB  |  57 lines

  1.  
  2.  
  3. {
  4.   int face = FaceGet("e-mode", 1); /* create one if missing */
  5.   if(face) {
  6.     int style;
  7.  
  8.     /* Get the style named "e-keywords" OR create one that is bold with
  9.        foreground pen 3 and background pen 0. If none matched and none
  10.        could be created, it will return the style of the best match and
  11.        no style will be named like this. */
  12.  
  13.     style = FaceStyle("e-keywords", "bold", 1, 0);
  14.     FaceAdd(face,  /* add word(s) to this face */
  15.             style, /* use the e-keywords style */
  16.             /* Specify all words we want to add to this face with this
  17.                particular style, we can of course add more words at a
  18.                later time */
  19.         "AND|ARRAY|BUT|CASE|CHAR|CONST|DEC|DEF|DEFAULT|DO|"
  20.         "ELSE|ELSEIF|ENDIF|ENDLOOP|ENDOBJECT|ENDPROC|ENDSELECT|"
  21.         "ENDWHILE|ENUM|EXCEPT|EXPORT|FOR|HANDLE|IF|INC|INCBIN|"
  22.         "INT|IS|JUMP|LIST|LONG|LOOP|MODULE|OBJECT|OF|OPT|OR|"
  23.         "PROC|PTR|RAISE|REAL|REPEAT|RETURN|SELECT|SET|SIZEOF|"
  24.         "STEP|STRING|THEN|TO|UNTIL|VOID|WHILE",
  25.             "word" /* these are word-only matches, that must be surrounded
  26.                       with non-word letters to get recognized */
  27.             );
  28.  
  29.     style = FaceStyle("e-comments", "italic", 3, 0);
  30.     FaceAdd(face, style, "/*", "anywhere|strong", "*/");
  31.     FaceAdd(face, style, "->", "anywhere|strong|doublechk", "\n");
  32.  
  33.     style = FaceStyle("e-string", "italic|bold", 2, 0);
  34.     FaceAdd(face, style, "'", "backslash", "'");
  35.  
  36.     style = FaceStyle("e-char", "italic|bold", 2, 0);
  37.     FaceAdd(face, style, "\"", "backslash", "\"");
  38.  
  39.   }
  40.   /* else
  41.     face is 0, which means GetFace() failed somehow! */
  42. }
  43.  
  44. /*
  45.  FLAGS for FaceAdd():
  46.  ====================
  47.  usepipe   - the pipe ('|') letter is a part of the actual string
  48.  word      - the string(s) must match as a word-only
  49.  anywhere  - matches wherever it appears in the text
  50.  strong    - a strong string. Will conquer weak ones.
  51.  weak      - a weak string. Will be conquered by strong ones.
  52.  1nonspace - must be the first non-whitespace on a line to match
  53.  backslash - a letter following a backslash will be ignored
  54.  doublechk - set this on strongs to make it check the weak too when
  55.              reaching the end (allowing them to end with the same string)
  56. */
  57.